package com.uit3j.cloud.product.listener;

import com.uit3j.cloud.common.rocketmq.config.RocketMqConstant;
import com.uit3j.cloud.common.util.Json;
import com.uit3j.cloud.product.service.HotSearchService;
import com.uit3j.cloud.product.vo.HotSearchVO;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 热搜管理
 * @author tan
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.HOT_SEARCH_TOPIC,consumerGroup = RocketMqConstant.HOT_SEARCH_TOPIC)
public class TopSearchConsumer implements RocketMQListener<HotSearchVO> {

    @Autowired
    private HotSearchService hotSearchService;

    private static final Logger LOG = LoggerFactory.getLogger(TopSearchConsumer.class);

    /**
     * 1、热搜管理
     *
     */
    @Override
    public void onMessage(HotSearchVO sendHotSearch) {
        LOG.info("热搜回调开始... message: " + Json.toJsonString(sendHotSearch));
//        hotSearchService.getByHotSearchId(hotSearchId);
    }
}
